home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / Information / GEOS.BOOK.ARC / GEOS (SBJ 11-86)
Encoding:
Text File  |  2019-04-13  |  6.8 KB  |  161 lines

  1. ***********************************************************************
  2. This article is being presented through the *StarBoard* Journal of  the
  3. FlagShip/StarShip  SIGs  (Special  Interest Groups) on Delphi and GEnie
  4. telecommunication networks.  Permission is hereby granted to non-profit
  5. organizations only to reprint this article or pass it along electronic-
  6. ally as long as proper credit is given  to  both  the  author  and  the
  7. *StarBoard* Journal.  
  8. ***********************************************************************
  9.  
  10.  
  11. The following discussion is an excerpt from the book,
  12. "How to Get the Most Out of GEOS, and is copyrighted 
  13. (C) 1986 by the Midnite Press/Midnite Software Gazette, 
  14. and MicroPACE Computers.  Permission is hereby granted 
  15. to non-profit groups to reprint this excerpt in its 
  16. entirety, provided that The Midnite Software Gazette 
  17. and Tim Sickbert are credited.  For more information, 
  18. please contact the Midnite Software Gazette at
  19.          P.O. Box 1747
  20.          Champaign, IL 61820
  21.  
  22. or via E-Mail
  23.          on Delphi:  MIDNIT
  24.          on Q-Link:  The Paper
  25.  
  26.  
  27.  
  28.  
  29.                       ASCII vs PETSCII
  30.  
  31. A big area of confusion exists around the differences that
  32. exist between ASCII and PETSCII.
  33.   
  34.     ASCII (American Standard Code for Information Interchange) is
  35. the standard code for micro-computers, and is used by MS DOS
  36. machines, CP/M machines, and others. True ASCII provides
  37. one hundred and twenty-eight codes, numbered 0-127, that 
  38. represent characters.  Control characters all have values from
  39. 0 to 31, punctuation and numerals have values from 32 through 63,
  40. upper case characters have values from 64 through 95, and lower
  41. case characters have values from 96 through 127. 
  42.  
  43.         PETSCII is a variation of the ASCII code used by the
  44. Commodore PET and VIC series of computers.  It was first used on
  45. the Commodore PET 2001, from which it got its name.  PETSCII is
  46. also used on the VIC series of computers.  (The VIC series
  47. includes the VIC 20, C64, and C128.  The series draws its name
  48. from the Video Interface Chip, or VIC, chip, which is present in
  49. some form in these three computers.)  PETSCII provides two
  50. hundred and fifty six codes, numbered 0-255, that represent
  51. characters.  It is nearly identical with ASCII for values through
  52. 63.  At values 64-95, however, PETSCII has lower case characters;
  53. from 96 through 191 it has graphics and reversed characters; from
  54. 192 through 218 it has upper case characters; and from 219
  55. through 255 it has more graphics characters. 
  56.  
  57.        To further complicate matters, the Commodore 64 has two
  58. character sets.  The default character set shows a lower case "a"
  59. as an upper case "A," and an upper case "A" as a graphic
  60. character that looks like a spade.  Thus this is known as the
  61. uppercase/graphics character set, uppercase/graphics mode, or
  62. local cursor up mode.  You may toggle into lowercase/uppercase,
  63. or local cursor down, mode by pressing the Commodore logo key
  64. (<logo>) and either of the <SHIFT> keys at the same time.  A
  65. lower case "a" will then appear as an "a," and a <SHIFT>ed "a"
  66. will appear as "A." 
  67.  
  68.      What appears on your screen as an "a" in lowercase/uppercase
  69. mode, or as an "A" in uppercase/graphics mode is represented in
  70. the computer as the value 65.  You can check this by using the
  71. CHR$() function or the ASC() function.  For example, in
  72. uppercase/graphics mode, enter the following commands:
  73.  
  74.           PRINT CHR$(65) and PRINT ASC("A")
  75.  
  76. Now toggle between the uppercase/graphics and lowercase/uppercase
  77. using the <logo><SHIFT> combination.  Now do the same with a
  78. <SHIFT>ed "A" and the value 193.  
  79.  
  80.        To really confuse matters  PRINT CHR$(97) in
  81. lowercase/uppercase mode.  Another upper case "A!"  But this is
  82. not really an "A."  This is a graphics character in Character Set
  83. 2 that just looks like a real "A."
  84.  
  85.      Some programs, such as GEOS, use true ASCII.  This will
  86. seldom be a problem, except when you use other programs for
  87. conversion or transmission over modem, such as the sequential
  88. file BUILD and UNBUILD programs in section two of How to Get the
  89. Most Out of GEOS.  To show the trouble, we will use the directory
  90. from BASIC.  First, load the directory of a GEOS disk from BASIC, or
  91. use a DOS wedge to list it.
  92.  
  93.        LOAD"$",8 <RETURN>
  94.             wait for <READY> prompt
  95.        LIST <RETURN>
  96. or
  97.        @$ <RETURN>
  98.            using the DOS Wedge.
  99.  
  100.       If you are in uppercase/graphics mode, the listing of the
  101. directory will have some upper case characters and many graphics. 
  102. If you are in lowercase/uppercase mode, the directory will look
  103. something like:
  104.  
  105.       0  "geos v1.2       " df 2a
  106.          1     "geos"             prg<
  107.          6     "geos boot"        prg<
  108.          85    "geos kernal"      usr<
  109.          119   "geopaint"         usr<
  110.          88    "geowrite"         usr<
  111.          17    "NOTE PAD"         usr 
  112.          16    "backup"           prg<
  113.          22    "PREFERENCE MGR"   usr 
  114.          23    "PHOTO MANAGER"    usr 
  115.          20    "TEXT MANAGER"     usr
  116.                      .
  117.                      .
  118.                      .
  119.  
  120.          Now we are going to use a little known trick of the
  121. Commodore DOS.  We can ask the disk drive if a certain file is on
  122. the disk.  For example, in lowercase/uppercase mode:
  123.  
  124.          load "$:geos",8 <RETURN>
  125.                 wait for <READY> prompt, and
  126.          list <RETURN>
  127. or
  128.          @$:geos <RETURN>
  129.  
  130.      The computer will display a directory with only the "geos"
  131. file.  You can do the same with "geos boot," "geos kernal,"
  132. "geopaint," "geowrite," and "backup."  Now try the same thing
  133. using upper case letters on a file like "NOTE PAD" or "PREFERENCE
  134. MGR."  You will get the first line of the directory and the
  135. number of blocks free, but no file names.
  136.  
  137.       This is because when you ask the disk drive to look for a
  138. file with the name "NOTE PAD," you are telling it to look for a
  139. file that has the codes
  140.  
  141.      [206,207,212,197,32,208,193,196]
  142.  
  143. but the name of the file on disk has the codes 
  144.  
  145.      [110,111,116,101,32,112,97,100].
  146.  
  147.      In lowercase/uppercase mode, the codes look the same.  The
  148. BUILD program in section 2 compensates for this with the little
  149. routine at 1490.  If this routine were not used, you would not be
  150. able to build a sequential file from a GEOS file unless you had
  151. used all upper case letters within GEOS for the file name. The
  152. trouble does not end there.  The routine at 1490 just lets you
  153. find the file on disk.  The BUILD program must give a name to the
  154. sequential file that it creates.  If it used the same codes as
  155. the original name, your telecommunications program might never be
  156. able to find the program you want to send.  The routine in lines
  157. 880)930 build a name that a terminal program can use for the new
  158. file.  GEOS is able to handle PETSCII for filenames, so this will
  159. not cause a problem when you UNBUILD the file back into GEOS
  160. format.  
  161.